package com.interview.javabase.algorithm;

import org.junit.Test;
import org.springframework.boot.test.context.SpringBootTest;

/**
 * @description:
 * @author: zhangshuguang@vichain.com
 * @date: 2019/06/12 15:19
 */
@SpringBootTest
public class Demo1 {

    @Test
    public void solution1() {
        Integer[] numbers = {2, 7, 11, 15};
        for (int i = 0; i < numbers.length; i++) {
            for (int j = i + 1; j < numbers.length; j++) {
                if (numbers[i] + numbers[j] == 9) {
                    System.out.println("index1=" + (i + 1) + " index2=" + (j + 1));
                }
            }
        }

    }
}
